<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
   	<%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="css/main.css" rel="stylesheet" type="text/css" />


<title>Menu Page</title>
</head>
<jsp:include page="top-nav-bar.jsp"/>
<body>
	<div class="container">
		<div class="header">
			<img class="header-image" src="img/header-image.png" alt="Cherry"
				name="header_image" id="header_image" />
		</div>
		<!-- end .header -->

		<div class="main-navigation">
			<c:import url="WEB-INF/xml/diet.xml" var="xmlDietDoc" />
			<c:import url="style-sheet/diet.xsl" var="xslDietDoc" />
			<x:transform xml="${xmlDietDoc}" xslt="${xslDietDoc}" />

			<c:import url="WEB-INF/xml/recipe.xml" var="xmlRecipeDoc" />
			<c:import url="style-sheet/recipe.xsl" var="xslRecipeDoc" />
			<x:transform xml="${xmlRecipeDoc}" xslt="${xslRecipeDoc}" />
		</div>
		
		
		<div class="menu-category">
			<h3>Healthy menu plans</h3>
		</div>
		<c:set var="id" value="${param.id}"/>
		<c:import var="xmlMenu" url="WEB-INF/xml/menu.xml"/>
		<x:parse var="doc" xml="${xmlMenu}" scope="page"/>
		<c:catch var="ex">
		<div class="menu-container">
			<x:forEach var="menu" select="$doc//Menu[dietId=$id]">
				<div class="menu-top">
		            <a href="MenuClientServlet?id=<x:out select="$menu/@id"/>&day=1&mealNum=<x:out select="$menu/numbermeal"/>&dayNum=<x:out select="$menu/numberday"/>">
		            	<img src="<x:out select="$menu/imgPath"/>" alt="<x:out select="$menu/name"/>">
		            </a>
		            <h5><a href="MenuClientServlet?id=<x:out select="$menu/@id"/>&day=1&mealNum=<x:out select="$menu/numbermeal"/>&dayNum=<x:out select="$menu/numberday"/>"><x:out select="$menu/name"/></a></h5>
		        </div>
			</x:forEach>
		</div>
		</c:catch>
		<c:if test="${not empty ex}">
			<font color="red">
			Error occur: ${ex}
			</font>
		</c:if>
		

		<div class="footer">
			<img src="img/fptuniversity.png" /> <span style="position: absolute">FPT
				University</span>
		</div>
	</div>
</body>
</html>